The present invention relates to an apparatus and a method for image processing, a recording medium, and a program, and particularly to an apparatus and a method for image processing, a recording medium, and a program suitable for use in generating a stereoscopic image on the basis of an image for the left eye and an image for the right eye, for example.
Many conventional methods are known which allow a two-dimensional image to be visually perceived three-dimensionally by using spatial difference (binocular parallax) between retina images obtained by the left and the right eye, respectively, of a human (the methods will hereinafter be described as stereoscopic methods).
The known stereoscopic methods include an anaglyph method, a color anaglyph method, a polarizing filter method, a time division stereoscopic television method and the like using special glasses, and a lenticular method and the like not using special glasses (for each method, see non-patent literature 1, for example).
In the anaglyph method, for example an image for the left eye (hereinafter described as an L image) is converted into a red monotone image and an image for the right eye (hereinafter described as an R image) is converted into a blue monotone image, and the red monotone image and the blue monotone image are superimposed on each other. Then the image is viewed with glasses having a red filter disposed on a left side thereof and a blue filter disposed on a right side thereof (hereinafter described as red and blue glasses). Although the anaglyph method can be carried out relatively easily and inexpensively, the entire image becomes a monotone image.
The color anaglyph method compensates the disadvantage of the anaglyph method. For a portion of an L image and an R image where corresponding positions in the images are displaced from each other when the L image and the R image are superimposed on each other (that is, a portion with a great parallax), as in the anaglyph method, for example the L image is converted into a red monotone image and the R image is converted into a blue monotone image, and the red monotone image and the blue monotone image are superimposed on each other. For a portion of the images where corresponding positions are not displaced from each other (that is, a portion with a small parallax), the images are superimposed on each other in original states of color. Then the image is viewed with red and blue glasses.
The color anaglyph method makes it possible to reproduce original color in the portion with a small parallax in the entire image. Incidentally, the color anaglyph method has a plurality of variations in terms of difference in color used for the portion with a small parallax. A method using original color in the portion with a small parallax will hereinafter be described as a first color anaglyph method. A method not using original color in the portion with a small parallax will hereinafter be described as a second color anaglyph method.
In the polarizing filter method, for example an L image projected by light linearly polarized in a vertical direction and an R image projected by light linearly polarized in a horizontal direction are superimposed on each other. Then the image is viewed with polarizing filter glasses having a vertical linear polarizing filter disposed on a left side thereof and a horizontal linear polarizing filter disposed on a right side thereof. The polarizing filter method has advantages of good color reproducibility and high resolution, but has a disadvantage of darkening the image by using the polarizing filters.
In the time division stereoscopic television method, an L image and an R image are displayed in each field cycle alternately on a television receiver, and the images are viewed with liquid crystal shutter glasses that have a left eye side and a right eye side opened and closed alternately in synchronism with field cycles of the television receiver. It is important in the time division stereoscopic television method to control the opening and closing operation of the liquid crystal shutter glasses with high accuracy.
In the lenticular method, a screen is divided into regions in a form of vertical stripes, and an L image and an R image are displayed alternately in a region on each stripe. The images are covered with a lens referred to as a lenticular screen.
In order to realize the various stereoscopic methods described above, an L image and an R image need to be obtained. The easiest method for obtaining an L image and an R image is that of moving the camera by an interval between both eyes of a human and shooting the same object twice.
In order to realize this easily, there is a camera having a stereoscopic photography mode that enables two images usable for stereoscopy to be taken continuously (see patent literature 1, for example).
Also, a method of attaching an optical adapter 11 including mirrors and the like to the outside of a picture taking lens 3 of a camera 1 as shown in FIG. 1, for example, is known as a method for obtaining an L image and an R image in one shot (see patent literature 2, for example).
FIG. 2 schematically shows a structure of the optical adapter 11. An optical image for the right eye which image is incident from a single light intake window is reflected by a mirror 21 toward a mirror 22, reflected by the mirror 22 toward the picture taking lens 3, and then condensed by the picture taking lens 3. An optical image for the left eye which image is incident from the single light intake window is condensed by the picture taking lens 3 without being reflected by the mirrors 21 and 22.
The optical images incident via the optical adapter 11 are taken as an image including a region for the left eye and a region for the right eye (the image will hereinafter be described as a parallax image) as shown in FIG. 3. The region for the left eye is used as an L image and the region for the right eye is used as an R image.
[Non-patent Literature 1]
“Fundamentals of Three-Dimensional Images” edited by NHK Science & Technical Research Laboratories under the supervision of Takehiro Izumi, Ohmsha, Ltd., published on Jun. 5, 1995
[Patent Literature 1]
Japanese Patent Laid-Open No. 2001-333327
[Patent Literature 2]
Japanese Patent Laid-Open No. Hei 11-46373
It is convenient if an image pair usable as an L image and an R image for stereoscopy can be detected from among a plurality of images taken in an ordinary method rather than using a parallax image taken by the camera mounted with the optical adapter 11 or an image pair for stereoscopy taken by the camera having the stereoscopic photography mode as described above as an L image and an R image. Conventionally, however, such method has not been established.